#include "OrderItem.h"
#include "ui_OrderItem.h"

OrderItem::OrderItem(QListWidget *parent) :
    QListWidget(parent),
    ui(new Ui::OrderItem)
{
    ui->setupUi(this);
}

OrderItem::~OrderItem()
{
    delete ui;
}

//加载订单
void OrderItem::init(int id){
    ui->order_label->setText(QString::number(id));
}

//查看详情按钮
void OrderItem::on_query_btn_clicked()
{
    FoodOrderTable food_order_table;
    FoodOrder foodOrder = food_order_table.queryFoodOrderById(ui->order_label->text().toInt());

    emit queryOrder(foodOrder);
}
